//
//  XRmenuPublic.h
//  XRmenu
//
//  Created by Gao Yan on 11-11-23.
//  Copyright 2011年 foxhis. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "VideoPlayer.h"

@class XRmenuError;
@class Product;
@interface XRmenuPublic : NSObject {

}
#pragma mark 通用日期类函数
+ (NSString *) getChineseDate;
+ (NSString *) getChineseTime:(NSDate *)cDate;
+ (NSString *) getChineseTimeStyle1:(NSDate *)cDate;
+ (NSString *) getChineseTimeStyle2:(NSDate *)cDate;

#pragma mark 语言翻译
+ (NSString*) translateString:(NSString*)txt;
+ (NSString*) translateImageName:(NSString*)filename;

#pragma mark 依据plist生成对象
+ (UIButton *) generalButton:(NSString*)stylename ButtonLable:(NSDictionary*)ldict ButtonFrame:(CGRect)fr;
+ (UIButton*) adjustButtonsImage:(UIButton*)bt Parms:(NSDictionary*)ldict;
+ (UIImageView *) generalImageView:(CGRect)fr;
+ (UILabel *) generalLabel:(NSString*)stylename LabelText:(NSString *)text LabelFrame:(CGRect)fr;
+(UITextAlignment) getTextAlignment:(NSUInteger)alignmentMode;
+ (UITextField *) generalTextField:(NSString*)stylename FieldFrame:(CGRect)fr;
+ (UIFont*) generalFont:(NSString*)stylename;
+ (UIColor*) generalFontColor:(NSString*)stylename;
+ (UIColor*) generalColor:(NSString*)colorname;
+ (NSString *) getGeneralImg:(NSString *)imgfile;
+ (VideoPlayer *) generalVideoView:(CGRect)fr;
+ (NSString *) getGeneralSkinImg:(NSString *)imgfile;

#pragma mark 菜品数据操作
+ (NSString *) convertImgNo:(NSString *)imgNo;
+(NSString*) getDishPhotoImageFileName:(NSString*)dish_uuid Error:(XRmenuError**)outError;	// 菜品大图，不带语言文字等
+(NSString*) getDishNameImageFileName:(NSString*)dish_uuid Error:(XRmenuError**)outError;	// 菜品大图配套的菜名图片，带语言文字等
+(NSArray*) getDishPhotoDetailesImageFilesName:(NSString*)dish_uuid Error:(XRmenuError**)outError;
+(NSString*) getDishGridImageFileName:(NSString*)dish_uuid Error:(XRmenuError**)outError;
+(NSString*)getDishImage:(NSString*)aPath Error:(XRmenuError**)outError;

//取得推荐图片列表
+(NSArray*) getCommandPhotoImageFilesNameWithError:(XRmenuError**)outError;


+(NSString*) jsonfield:(NSString*)content;

+(NSInteger) getOrderedNum;
+(NSInteger) getProductNum:(Product*)item;

+(BOOL) insertNewOrder:(Product*)item;
+(BOOL) updateProductNum:(Product*)item Num:(NSNumber*)n;
+(BOOL) clearProduct:(Product*)item;
+(BOOL) clearAllProduct;

+(NSMutableArray*) getAllCommendProduct;
#pragma mark 大图风格下的数据操作
+(NSString*) haveAudioFile:(Product*)item Error:(XRmenuError**)outError;
+(NSString*) haveVedioFile:(Product*)item Error:(XRmenuError**)outError;
+(NSMutableArray*) haveRelationProduct:(Product*)item;

#pragma mark 数据刷新基本方法
+(NSMutableArray*) refreshProductByCatalogPath:(NSString*)cpath;
+(NSMutableArray*) refreshProductByTag:(NSString*)tid;
@end
